import Vue from 'vue'
import Router from 'vue-router'
import {
  Login,//登录页面
  Personal,//个人中心
  MakePersonal,//制作页（个人中心）
  Business,//名片
  EditBusiness,//编辑名片
  PhotoWall,//照片墙
  Greeting,//贺卡
  GreetingTitle,//贺卡标题
  GreetingEdit,//贺卡编辑
  GreetingDetail,//贺卡详情
  BaiduMap,//百度地图
  PicCutOut,//图片截取上传
  HeadCutOut,//图片截取上传
} from './type'

Vue.use(Router)
export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/', redirect: '/login',
      meta: {keepAlive: false, isBack: false}
    },//登录页面
    {
      path: '/login', name: 'login', component: Login,
      meta: {keepAlive: false, isBack: false}
    },//登录页面
    {
      path: '/personal', name: 'personal', component: Personal,
      meta: {keepAlive: false, isBack: false}
    },//个人中心
    {
      path: '/makePersonal', name: 'makePersonal', component: MakePersonal,
      meta: {keepAlive: false, isBack: false}
    },//制作页面（个人中心）
    {
      path: '/makePersonal/:id/:cid', name: 'makePersonal', component: MakePersonal,
      meta: {keepAlive: false, isBack: false}
    },//制作页面（个人中心）
    {
      path: '/business/:token', name: 'business', component: Business,
      meta: {keepAlive: false, isBack: false}
    },//名片
    {
      path: '/editBusiness/:id', name: 'editBusiness', component: EditBusiness,
      meta: {keepAlive: false, isBack: false}
    },//编辑名片
    {
      path: '/photoWall', name: 'photoWall', component: PhotoWall,
      meta: {keepAlive: false, isBack: false}
    },//照片墙
    {
      path: '/greeting', name: 'greeting', component: Greeting,
      meta: {keepAlive: false, isBack: false}
    },//贺卡列表
    {
      path: '/greetingTitle', name: 'greetingTitle', component: GreetingTitle,
      meta: {keepAlive: false, isBack: false}
    },//贺卡标题
    {
      path: '/greetingEdit/:id', name: 'greetingEdit', component: GreetingEdit,
      meta: {keepAlive: false, isBack: false}
    },//贺卡编辑
    {
      path: '/greetingDetail/:id/:token', name: 'greetingDetail', component: GreetingDetail,
      meta: {keepAlive: false, isBack: false}
    },//贺卡详情
    {
      path: '/baiduMap/:name', name: 'baiduMap', component: BaiduMap,
      meta: {keepAlive: false, isBack: false}
    },//百度地图
    {
      path: '/picCutOut', name: 'picCutOut', component: PicCutOut,
      meta: {keepAlive: false, isBack: false}
    },//贺卡图片上传截取
    {
      path: '/headCutOut', name: 'headCutOut', component: HeadCutOut,
      meta: {keepAlive: false, isBack: false}
    },//头像图片上传截取
  ]
})
